/**
 * Alipay.com Inc.
 * Copyright (c) 2004-2013 All Rights Reserved.
 */
package com.h2o3.sample.service.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.h2o3.sample.model.User;
import com.h2o3.sample.persistence.UserMapper;
import com.h2o3.sample.service.UserService;

/**
 * @author chensheng
 * @version $Id: UserServiceImpl.java, v 0.1 11/29/13 2:34 AM chensheng Exp $
 */
@Service
public class UserServiceImpl implements UserService {
    private static final Logger logger = LoggerFactory.getLogger(UserServiceImpl.class);

    @Autowired
    UserMapper                  userMapper;

    @Override
    public User get(String id) {
        return userMapper.get(id);
    }

    @Override
    @Transactional
    public void createUser(User user) {
        userMapper.createUser(user);
        userMapper.createUser(user);
    }

    public UserMapper getUserMapper() {
        return userMapper;
    }

    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

}
